﻿using UnityEngine;
using UnityEngine.UI;

public class UIPanel : MonoBehaviour {

	public RawImage charaAImg;
	public RawImage charaBImg;
	public Image contentBg;
	public Text contentTxt;
	public Canvas canvas;
	public GameObject btnA;
	public GameObject btnB;

	public void SetButtonNames(string nameA, string nameB)
	{
		btnA.name = nameA;
		btnB.name = nameB;
	}

	public void ShowButtons(bool value)
	{
		btnA.SetActive(value);
		btnB.SetActive(value);
	}

	public void SetButtonTexts(string txtA, string txtB)
	{
		Text tempTxt = btnA.GetComponentInChildren<Text>();
		tempTxt.text = txtA;
		tempTxt = btnB.GetComponentInChildren<Text>();
		tempTxt.text = txtB;
	}

	public void ShowCanvas(bool value)
	{
		canvas.enabled = value;
	}

	public void ShowCharaA(bool value)
	{
		charaAImg.enabled = value;
	}

	public void ShowCharaB(bool value)
	{
		charaBImg.enabled = value;
	}

	public void ShowContentBg(bool value)
	{
		contentBg.enabled = value;
	}

	public void ShowContentText(bool value)
	{
		contentTxt.enabled = value;
	}

	public void SetContentText(string value)
	{
		contentTxt.text = value;
	}

	public void ChangeCharaATex(Texture tex)
	{
		charaAImg.texture = tex; // 改变角色图片
	}

	public void ChangeCharaBTex(Texture tex)
	{
		charaBImg.texture = tex; // 改变角色图片
	}
}
